package com.meilai.project.mapper.business.building;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.meilai.project.entity.business.building.BuildingAreaAudienceRelation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 张驰
 * @date 2021/4/1 14:00
 */
@Mapper
public interface BuildingAreaAudienceRelationMapper extends BaseMapper<BuildingAreaAudienceRelation> {
    @Delete("delete from building_area_audience_relation where building_area_id=#{buildingAreaId};")
    boolean deleteByBuildingAreaId(@Param("buildingAreaId") Long buildingAreaId);

    boolean insertRelations(@Param("buildingAreaId") Long buildingAreaId,
                            @Param("audienceIds") List<Long> audienceIds);
}
